namespace ConsoleApp1._1013;
//打印菱形，根据输入的行数，显示菱形形状
using System;

public class six{
    public static void run()
    {
        Console.Write("请输入菱形的行数（需为奇数）：");
        int n = int.Parse(Console.ReadLine());
        int mid = n / 2 + 1;
        
        for (int i = 1; i <= mid; i++)
        {
            for (int j = 1; j <= mid - i; j++)
            {
                Console.Write(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++)
            {
                Console.Write("*");
            }
            Console.WriteLine();
        }
        for (int i = mid - 1; i >= 1; i--)
        {
            for (int j = 1; j <= mid - i; j++)
            {
                Console.Write(" ");
            }
            for (int k = 1; k <= 2 * i - 1; k++)
            {
                Console.Write("*");
            }
            Console.WriteLine();
        }
    }
}
